In ASCII, 0xa0 represents the beginning of a Chinese character where a function in PHP, the Ord () function, returns the Askii code value of a character, such as Ord (' A ') = 65;function gbsubstr ($string, $start, $length) { if(strlen ($string) >$length) { $str=null; $len=$start+$length; for($i=$start; $i$len; $i+ +) { if(Ord (substr ($string,$i,1)) >0xa0) { the//ord () function
increases the difficulty of reverse analysis.0x03 what needs to be implemented?
After understanding the principles of code virtualization, I learned that the principle is to customize a set of bytecode and then use an interpreter to explain how to run the bytecode. Therefore, the objective is divided into two parts:
Define bytecode
The bytecode is just an identifier that can be defined at will. The following is the defined bytecode. Each instruction identifier corresponds to one byte.
/** Opcod
interrupt to determine whether new data is received. After the CPU receives the interrupt request, the interrupt handler reads data from iicds.
(4) control byte values:
The address of the retrieved device (A0) + operation control command (R/W ):
1) sent by the primary device: 0xa0; received by the primary device: 0xa1
2) 24lc04 contains 512 bytes, which are divided into 256 bytes and 256 bytes. The Byte addresses are
GB2312: area codes and bit numbers. as I said earlier, a GB2312 character is expressed in two bytes: (High byte, low byte). The first byte is called "High byte", the second byte is called "Low byte" PS: Because high general row left bar ~ so called high byte ...
The algorithm is as follows: a GB2312 character = = (0xa0 + area code, 0XA0 + bit number). According to this algorithm, you can take a look at the
. C, there is a function _ gui_puthz that can be used to display Chinese characters. Using this function, I have designed several functions to output the gb2312 font with different widths and heights. Description:
// This function can display font data of any height or width. Hz_addr = (uint8 *) hz_font_addr is the word
The starting address of the database. Hz_addr = (uint8 *) hz_font_addr + 128 * hz_bytes1 is the starting address of Chinese characters.
Important: TMP = (* CHR) * hz_bytes1 and T
usually used for compatibility with ASCII. The "GB2312" on the browser 's coded table usually refers to the "EUC-CN" notation.
Each character and symbol is expressed in two bytes . The first byte is called "High byte", and the second byte is called "Low byte."
"High byte" uses 0xa1-0xf7 (the area code of area 01-87 plus 0xa0), "Low byte" uses 0xa1-0xfe (01-94 plus 0xa0). Since the first level of Chinese
is "low byte".
"High byte" uses 0xa1-0xf7 (the area code of area 01-87 plus 0xa0), "Low byte" uses 0xa1-0xfe (01-94 plus 0xa0).
5. Code examples
In the GB2312 character set of the first Chinese character "Ah" as an example, its area code 16, bit number 01, the location code is 1601, in most computer programs, high byte and low byte respectively add 0xa0 to ge
byte".
"High byte" uses 0xa1-0xf7 (the area code of area 01-87 plus 0xa0), "Low byte" uses 0xa1-0xfe (01-94 plus 0xa0).
5. Code examples
In the GB2312 character set of the first Chinese character "Ah" as an example, its area code 16, bit number 01, the location code is 1601, in most computer programs, high byte and low byte respectively add 0xa0 to get the pr
respectively, and the status registers are located at 0x20 and 0xa0. A specific position in the shielding register will enable a certain interruption, and write 0 to block it. Unfortunately, the interrupt shield register is only written, so you cannot read the value you write. This also means that Linux must save a local copy of the write value of the shielded register. Generally, these stored values are modified in the interrupt enable and shield ro
In GB 2312, the received Chinese characters are "partitioned", with 94 characters/symbols per zone. This representation is also called Location code. 1) Area 01-09 is a special symbol. 2) 16-55 is a first-level Chinese character, sorted by pinyin. 3) 56-87 is a two-level Chinese character, sorted by radical/stroke. 4) 10-15 and 88-94 regions are not encoded. In programs that use GB2312, the EUC storage method is usually used for compatibility with ASCII. The "GB2312" on the brows
, all the places involved in character conversion do not need to be converted, so that no garbled characters are generated.
With the above theoretical analysis, we combine a garbled bag case, deepen understanding, some of the problems, please think about it, see if you really understand.
Environment: +--------------------------+-----------------------------------------------------+| variable_name | Value |+--------------------------+-----------------------------------------------------+| chara
called Location code.Area 01-09 is a special symbol.16-55 is a class of Chinese characters, sorted by pinyin.The 56-87 area is a class two Chinese character, sorted by radical/stroke.10-15 Districts and 88-94 districts are not encoded.For example, the word "ah" is the first Chinese character in the GB2312, and its location code is 1601.
BYTE structure
In programs that use GB2312, the EUC storage method is usually used for compatibility with ASCII. The "GB2312" on the browser's coded table usu
Cancel the current operation
0x06 to 0x0f
Reserved
As extended retention
0x10 to 0x1f
User definable
User-defined
* Always set Finalbit
Responsecode
Responsecode
Defined
0x10 (0x90)
Continue (continued)
0x20 (0xa0)
Ok,success
0x40 (0XC0)
Bad Request (service side does not understand request)
0x41 (0xC1)
Unauthorized (Unauthorized)
0x43 (0XC3)
Fobidden (Forbidden--Server understands request, but refuses)
0x44 (0XC4)
Not Found (
, char *s, unsigned colidx){size_t SL = strlen (s);Put_string_ascii (x – (SL/2) * Ascii_width,Y–FONT_SIZE/2, S, COLIDX);}/*** __display_font_16–display a 16x16 (Chinese) Character on touch screen* @fp: File pointer points to HZK (ie, HZK16)* @x:column* @y:row* @font: Which (Chinese) character to display* @colidx: Color index* This routine only display 16*16 character.* Every character takes-bytes, we show the first 8 bits, then the second 8 bits,* Then the whole world would be shown before us.*/
"I" character lattice code
Author: Zhang guiquan
The following is the bitmap encoding of the word "I. Different encoding mode sizes show different characters.
Char wo12s [] = {/* The following is the 12-dot matrix of 'my', 24 bytes */0x0a, 0x80, 0xf2, 0x40, 0x12, 0x00, 0xff, 0xe0,0x40, 0x3a, 0x80, 0xd1, 0x00,0x13, 0x20, 0x1c, 0xa0, 0x70, 0x60, 0 x, 0x00,};
Char wo16s [] = {/* The following is the 'my' 16-dot-matrix ry font, 32 bytes */0 x, 0 x, 0x50,
, two Chinese characters 3,008, and 682 full-width characters including Latin alphabet, Greek alphabet, Japanese hiragana and katakana letters, Russian Cyrillic letters.
4. Technical characteristics
(1) The partition means:
In GB2312, the collected Chinese characters are "partitioned" and each area contains 94 characters/symbols. This representation is also called Location code.
Each area contains the following characters: 01-09 is a special symbol, 16-55 is a first-level Chinese character,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.